
// 11901
import { isArrLike } from './isArrLike'
import { isArr } from './isArr'
import { isStr } from './isStr'
import { map } from '../tools/map'

/**
 * 将任意值转换为数组
 * isArrLike map isArr isStr
 * @param {*} val 
 * @returns 
 */
export function toArr (val) {
  if (!val) return [];
  if (isArr(val)) return val;
  if (isArrLike(val) && !isStr(val)) return map(val);
  return [val];
 }